home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / Chip Mayıs 2001.iso / prog / share / 14 / setup.exe / %MAINDIR% / Scripts / VB script sample 1.vbs < prev    next >
Encoding:
Text File  |  2001-03-30  |  1.6 KB  |  61 lines

  1. '    File:       kyle.vbs
  2. '    Description:  Sample of using TEConnection object 
  3. '           from visual basic
  4. '    Created:       February 7, 2001
  5. '
  6. ' Copyright (c) 2000 GlobalSCAPE, Inc.
  7. '    The copyright to the computer program(s) herein
  8. '    is the property of GlobalSCAPE, Inc.
  9. '    The program(s) may be used and/or copied  only with
  10. '    the written permission of  GlobalSCAPE, Inc.
  11. '    or in accordance   with the terms and conditions
  12. '    stipulated   in the agreement/contract under which
  13. '    the  program(s) have been supplied.
  14. '
  15.  
  16.     'Variable declaration
  17.     Dim Kyle
  18.         
  19.     'Create TEConnection object
  20.     Set Kyle  = CreateObject("CuteFTPPro.TEConnection")
  21.  
  22.     'Create standard Shell object
  23.     Set Shell = CreateObject("WScript.Shell")
  24.  
  25.     Kyle.Protocol = "FTP"
  26.     Kyle.Host = "Kyle.globalscape.com"
  27.     Kyle.Login = "anonymous"
  28.     Kyle.UseProxy = "BOTH"
  29.     Kyle.RemoteFolder = "/Pub"
  30.     
  31.     'Get name of desctop folder
  32.     strDesktop = Shell.SpecialFolders("Desktop")
  33.     Kyle.Localfolder = strDesktop
  34.  
  35.     'Display message box
  36.     nUserChoise = MsgBox ("Script is going to download latest version of CuteZip onto your desktop", 1)
  37.  
  38.     'Quit if user clicked "Cancel"
  39.     If nUserChoise = 2 Then
  40.         Quit(1)
  41.     End If
  42.  
  43.     If (Not Kyle.RemoteExists("cutezip")) Then
  44.         MsgBox "Remote folder does not exist"
  45.         Quit(1)
  46.     End If
  47.  
  48.     If(Not Kyle.RemoteExists("cutezip/cutezip.exe")) Then
  49.         MsgBox "Remote file does not exist"
  50.         Quit(1)
  51.     End If
  52.  
  53.     'Initiate download
  54.     Kyle.Download "cutezip/cutezip.exe", strDesktop+"\cutezip.exe"
  55.  
  56.  
  57.  
  58.  
  59.  
  60.     
  61.